package org.directfire.player;

import org.acra.*;
import org.acra.annotation.*;
import android.app.Application;
import android.content.Context;
import android.support.v4.app.FragmentActivity;

/**
 *   Copyright (C) 2012 Alexey Kostrjitskiy mailto:alex@ipss.net
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 *
 * $Id: DirectFire.java 33 2012-08-27 16:29:21Z alexeyvk@gmail.com $<br/>
 * $HeadURL: http://directfire.googlecode.com/svn/trunk/DirectFireAndroid/src/org/directfire/player/DirectFire.java $<br/><br/>
 *
 * Main DirectFirePlayer application class.
 */
@ReportsCrashes( formKey = "dDZtdDRBZzdqR0h4TVlIcXFRa0FweVE6MQ",
mode = ReportingInteractionMode.DIALOG,
resToastText = R.string.crash_toast_text, // optional, displayed as soon as the crash occurs, before collecting data which can take a few seconds
resDialogText = R.string.crash_dialog_text,
resDialogIcon = android.R.drawable.ic_dialog_info, //optional. default is a warning sign
resDialogTitle = R.string.crash_dialog_title, // optional. default is your application name
resDialogCommentPrompt = R.string.crash_dialog_comment_prompt, // optional. when defined, adds a user text field input with this text resource as a label
resDialogOkToast = R.string.crash_dialog_ok_toast // optional. displays a Toast message when the user accepts to send a report.
)
public class DirectFire extends Application {
  private static Context mContext;
  private static FragmentActivity currentlyVisible=null;

  public void onCreate(){
  	ACRA.init(this);
    super.onCreate();
  	mContext = this;
  }

  public static Context getContext(){
	return mContext;
  }

  public static FragmentActivity getActivity(){
	return currentlyVisible;
  }

  public static void setActivity(FragmentActivity visible){
	currentlyVisible = visible;
  }
}
